<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /*
                         new 做了什么
                         创建一个新对象
                         函数内部this指向这个对象
                         执行构造函数代码
                         返回新对象
                        */
        function Person(name, age, sex) {
            this.name = name
            this.age = age
            this.sex = sex
        }

        const p1 = new Person('超帅', 18, '男')
        console.log(p1);
    </script>
</body>

</html>